<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=no">
    <meta name="referrer" content="origin">
    <title>日新网 - 小程序支付测试</title>
    <link rel="stylesheet" href="__TMPL__Public/assets/css/bootstrap.min.css">
    <link rel="stylesheet" href="__TMPL__Public/assets/css/reset.css">
    <link rel="stylesheet" href="__TMPL__Public/assets/css/style.css">
    <script type="text/javascript" src="__TMPL__Public/assets/js/rem.js"></script>
</head>
<body>
<!--nav-->
<tc_include file="Public:nav"/>
<div>
    <button id="goMiniPay">去支付</button>
</div>
<!--页脚-->
<tc_include file="Public:footer"/>

<script type="text/javascript" src="__PUBLIC__/js/wx/jweixin-1.3.2.js"></script>
<script>
    function goMiniPay() {
        // 判断是否是小程序打开
        wx.miniProgram.getEnv(function(res) {
            if (res.miniprogram) { //在小程序中
                wx.miniProgram.navigateTo({
                    url : '/pages/pay/pay?id=123',
                })
            }
        });
    }
    $(function () {
        $('#goMiniPay').click(function () {
            goMiniPay();
        })
    })
</script>

<script type="text/javascript" src="__TMPL__Public/assets/js/jquery.1.12.4.js"></script>
<script src="__TMPL__Public/assets/js/bootstrap.min.js"></script>

</body>
</html>